import httpInstance from "@/utils/http";

export function share(fileList,time) {
    return httpInstance({
        method: "post",
        url: `/share/file/${fileList}/${time}`
    })
}

export function parseUrl(url,code) {
    return httpInstance({
        method: "post",
        url: `/share/file/parse`,
        data: {
            url:url,
            code:code
        }
    })
}

export function urlExist(url,code) {
    return httpInstance({
        method: "post",
        url: `/share/file/urlExist`,
        data: {
            url:url,
            code:code
        }
    })
}

export function shareList() {
    return httpInstance({
        method: "get",
        url: `/share/list`
    })
}

export function shareCount(id) {
    return httpInstance({
        method: "get",
        url: `/shareLink/count/${id}`
    })
}

export function unShareFile(ids) {
    return httpInstance({
        method: "delete",
        url: `/share/unshare/${ids}`
    })
}

export function getShareLink(id) {
    return httpInstance({
        method: "get",
        url: `/shareLink/${id}`
    })
}

export function parseUser(url) {
    return httpInstance({
        method: "get",
        url: `/shareLink/parse/user/${url}`,
    })
}

export function getShareFolder(id) {
    return httpInstance({
        method: "get",
        url: `/shareLink/folder/${id}`,
    })
}

export function ownLink(url) {
    return httpInstance({
        method: "get",
        url: `/shareLink/ownLink/${url}`,
    })
}